Skip to content

feat(deps): migrate to ipx v4 - #2094

Merged
danielroe merged 4 commits into
mainfrom
feat/ipx-v4
Jul 28, 2026
Merged

feat(deps): migrate to ipx v4#2094
danielroe merged 4 commits into
mainfrom
feat/ipx-v4

Conversation

@danielroe

@danielroe danielroe commented Jan 22, 2026

Copy link
Copy Markdown
Member

🔗 Linked issue

resolves #2063
resolves #1425
resolves #1697

closes #2181

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

this migrates us to ipx v4 🎉

@danielroe
danielroe requested a review from pi0 January 22, 2026 22:56
@pkg-pr-new

pkg-pr-new Bot commented Jan 22, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@2094

commit: b936579

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jan 22, 2026

Copy link
Copy Markdown

Deploying nuxt-image with  Cloudflare Pages  Cloudflare Pages

Latest commit: b936579
Status: ✅  Deploy successful!
Preview URL: https://28f7de0c.nuxt-image.pages.dev
Branch Preview URL: https://feat-ipx-v4.nuxt-image.pages.dev

View logs

@codecov-commenter

codecov-commenter commented Jan 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 32.61%. Comparing base (100bed3) to head (b936579).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2094   +/-   ##
=======================================
  Coverage   32.61%   32.61%           
=======================================
  Files           7        7           
  Lines         371      371           
  Branches      131      131           
=======================================
  Hits          121      121           
  Misses        194      194           
  Partials       56       56           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@maximepvrt maximepvrt mentioned this pull request Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The IPX dependency is upgraded to 4.0.0-beta.1. The workspace excludes this prerelease from minimum release-age checks, IPXModifiers is re-exported from ipx, and the server route switches to createIPXNodeHandler with custom base URL and query-string mapping.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: migrating to ipx v4.
Description check ✅ Passed The description is on-topic and matches the ipx v4 migration.
Linked Issues check ✅ Passed The PR addresses [#2063, #1425, #1697] by migrating to ipx v4, switching to the Node handler, and preserving decimal-width URLs during prerendering.
Out of Scope Changes check ✅ Passed All changes relate to the ipx v4 migration, runtime handler update, or dependency gating, with no unrelated edits evident.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ipx-v4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/runtime/server/routes/_ipx.ts (1)

30-54: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add regression coverage for the H3-to-Fetch translation.

Codecov reports no coverage for this new path. Add tests for the default and a custom baseURL, including query preservation and successful image response forwarding; this replaces useBase’s previously tested framework behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/runtime/server/routes/_ipx.ts` around lines 30 - 54, Add regression tests
covering the H3 event handler’s Fetch translation through _handler: verify the
default and custom baseURL paths are stripped correctly, query parameters are
preserved, and a successful image response is forwarded. Replace the prior
useBase framework-behavior coverage with these route-specific tests.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/runtime/server/routes/_ipx.ts`:
- Around line 30-54: Add regression tests covering the H3 event handler’s Fetch
translation through _handler: verify the default and custom baseURL paths are
stripped correctly, query parameters are preserved, and a successful image
response is forwarded. Replace the prior useBase framework-behavior coverage
with these route-specific tests.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 914afa4a-163b-44af-aed0-6c5871076611

📥 Commits

Reviewing files that changed from the base of the PR and between 41790ef and 20a26a9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • src/runtime/server/routes/_ipx.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/runtime/server/routes/_ipx.ts`:
- Line 5: Update the h3 adapter import used by the IPX route to one exported by
the installed h3 version, replacing fromNodeHandler with fromNodeMiddleware if
its NodeHttpHandler signature is compatible. Keep lazyEventHandler behavior
unchanged and verify the surrounding handler invocation remains type-safe.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d6cc2db-ced9-43f4-aee1-fc7650d6e643

📥 Commits

Reviewing files that changed from the base of the PR and between 20a26a9 and a3b1238.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • package.json
  • pnpm-workspace.yaml
  • src/runtime/providers/ipx.ts
  • src/runtime/server/routes/_ipx.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

Comment thread src/runtime/server/routes/_ipx.ts Outdated
Comment thread package.json Outdated

@pi0 pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

other than pinning dep LGTM!

@maximepvrt

Copy link
Copy Markdown
Contributor

This PR resolves #2181

@socket-security

socket-security Bot commented Jul 28, 2026

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/runtime/server/routes/_ipx.ts`:
- Around line 30-39: Update the baseURL handling in the createIPXNodeHandler
parseURL callback: normalize opts.baseURL by removing its trailing slash before
matching, then strip it only when pathname equals the normalized mount or starts
with the mount followed by '/'. Preserve '/' when the stripped pathname is
empty, and use the normalized value when reconstructing the URL for parseIPXURL.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 86f3fb76-e494-4b80-9112-21c3757422d1

📥 Commits

Reviewing files that changed from the base of the PR and between fb5e0b9 and cb6c6a0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (4)
  • package.json
  • pnpm-workspace.yaml
  • src/runtime/providers/ipx.ts
  • src/runtime/server/routes/_ipx.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • pnpm-workspace.yaml
  • src/runtime/providers/ipx.ts
  • package.json

Comment thread src/runtime/server/routes/_ipx.ts Outdated
@danielroe
danielroe added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit 64b96c1 Jul 28, 2026
16 checks passed
@danielroe
danielroe deleted the feat/ipx-v4 branch July 28, 2026 15:57
@maximepvrt

Copy link
Copy Markdown
Contributor

Fixes #2035
Fixes #2075
Closes #1891

@danielroe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate to new ipx APIs free() invalid size ipx 500 with non-rounded image widths during prerender

4 participants